import { http } from "@/utils/http";
import type { CommentDto, CommentVo } from "@/type";

export const commentApi = {
  getCommentList: (id: number) => {
    return http.get<{ total: number; comments: CommentVo[] }>(
      `/comments/${id}/posts`,
    );
  },
  addComment: (data: CommentDto) => {
    return http.post<any>("/comments/create", data);
  },
};
